<template>
  <div class="nav" @click="goback">
    <router-link to="/film"  tag="div">
      <p>猫眼电影</p>
      <span>
        <img
          src="https://p0.meituan.net/scarlett/f05f61e7a8f3f45fd071c068d7a26870356.png"
          alt=""
        />
        <ul>
          <li @click="goback"><a href="">首页</a></li>
          <li><a href="">榜单</a></li>
          <li><a href="">热点</a></li>
          <li><a href="">商城</a></li>
        </ul>
      </span>
    </router-link>
  </div>
</template>

<script>
// import导入样式
// import "@/assets/iconfont/iconfont.css";

export default {
  data() {
    return {};
  },
  methods:{
    goback() {
      this.$router.go('/film/nowplaying')
    },
  },
  mounted() {},
  methods:{
    goback(){
      this.$router.go(-1)
    }
  }
};
</script>

<style lang="scss" scoped>
.nav {
  height: 52px;
  width: 100%;
  text-align: center;


  div {
    height: 52px;
    background: #e54847;
    p {
      float: left;
      text-indent: 150px;
      line-height: 52px;
      color: white;
      font-size: 18px;
    }
    span {
      float: right;
      margin-right: 12px;
      img {
        display: inline-block;
        width: 24px;
        height: 24px;
        margin-top: 14px;
      }
      ul {
        width: 100px;
        position: fixed;
        display: none;
        right: 10px;
        top: 45px;
        z-index: 20;
        box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3),
          0px 0px 8px rgba(0, 0, 0, 0.1);
        background: #fff;
        li  a{
          display: block;
          text-decoration: none;
          height: 30px;
          border: 1px solid rgb(231, 228, 228);
          line-height: 30px;
          font-size: 14px;
          color:#000;
        }
      }
    }
    span:hover ul {
      display: block;
    }
  }
}
</style>